<form method="post" action="<!--[pnmodurl modname=hotelbooking type=userform func=submit ctrl=hotelallotment]-->">
<!--[if $status eq "edit"]-->
	<!--[getRoomList]-->
	<input name="status" type="hidden" value="edit" />
	<h2><!--[$strMonth]--></h2>
	<!--[foreach from=$dateList item=itemDay key=monthKey]-->
		<table border="1px">
			<tr>
			<th>
				Room Type
			</th>
			<!--[foreach from=$itemDay item=itemDay2 key=dayKey name=loopDay]-->
				<!--[if $smarty.foreach.loopDay.index < 15]-->
					<th><!--[$dayKey]--><br /><!--[$itemDay2|substr:0:3]--></th>	
				<!--[/if]-->
			<!--[/foreach]-->
			</tr>
			<!--[foreach from=$roomList item=itemRoom key=key]-->
			<!--[assign var="roomID" value=$itemRoom.id]-->
				<tr>
					<td>
						<!--[$itemRoom.name]-->
					</td>
					<!--[foreach from=$itemDay item=itemDay2 key=dayKey name=loopDay]-->
						<!--[if $smarty.foreach.loopDay.index < 15]-->
							<!--[assign var="numDay" value=$dayKey|string_format:"%02s"]-->
							<td><input name="form[<!--[$itemRoom.id]-->][<!--[$currentYear]-->][<!--[$currentMonth]-->][<!--[$dayKey]-->][<!--[$dateAollotmentList.$roomID.$currentYear.$currentMonth.$numDay.id]-->]" type="text" size="2" value="<!--[$dateAollotmentList.$roomID.$currentYear.$currentMonth.$numDay.allotment]-->" /></td>
						<!--[/if]-->
					<!--[/foreach]-->
				</tr>
			<!--[/foreach]-->
		</table>
	<!--[/foreach]-->

	<!--[foreach from=$dateList item=itemDay key=monthKey]-->
		<table border="1px">
			<tr>
			<th>
				Room Type
			</th>
			<!--[foreach from=$itemDay item=itemDay2 key=dayKey name=loopDay]-->
				<!--[if $smarty.foreach.loopDay.index >= 15]-->
					<th><!--[$dayKey]--><br /><!--[$itemDay2|substr:0:3]--></th>	
				<!--[/if]-->
			<!--[/foreach]-->
			</tr>
			<!--[foreach from=$roomList item=itemRoom key=key]-->
			<!--[assign var="roomID" value=$itemRoom.id]-->
				<tr>
					<td>
						<!--[$itemRoom.name]-->
					</td>
					<!--[foreach from=$itemDay item=itemDay2 key=dayKey name=loopDay]-->
						<!--[if $smarty.foreach.loopDay.index >= 15]-->
							<!--[assign var="numDay" value=$dayKey|string_format:"%02s"]-->
							<td><input name="form[<!--[$itemRoom.id]-->][<!--[$currentYear]-->][<!--[$currentMonth]-->][<!--[$dayKey]-->][<!--[$dateAollotmentList.$roomID.$currentYear.$currentMonth.$numDay.id]-->]" type="text" size="2" value="<!--[$dateAollotmentList.$roomID.$currentYear.$currentMonth.$numDay.allotment]-->" /></td>	
						<!--[/if]-->
					<!--[/foreach]-->
				</tr>
			<!--[/foreach]-->
		</table>
	<!--[/foreach]-->
	
<!--[else]-->


	<input name="status" type="hidden" value="new" />
	<!--[getRoomList]-->
	<!--[$roomList|@var_dump]-->
	<!--[foreach from=$dateList item=itemDay key=monthKey]-->
		<h2><!--[$monthKey]--></h2>
		<table border="1px">
			<tr>
			<th>
				Room Type
			</th>
			<!--[foreach from=$itemDay item=itemDay2 key=dayKey name=loopDay]-->
				<!--[if $smarty.foreach.loopDay.index < 15]-->
					<th><!--[$dayKey]--><br /><!--[$itemDay2|substr:0:3]--></th>	
				<!--[/if]-->
			<!--[/foreach]-->
			</tr>
			<!--[foreach from=$roomList item=itemRoom key=key]-->
				<tr>
					<td>
						<!--[$itemRoom.name]-->
					</td>
					<!--[foreach from=$itemDay item=itemDay2 key=dayKey name=loopDay]-->
						<!--[if $smarty.foreach.loopDay.index < 15]-->
							<td><input name="form[<!--[$itemRoom.id]-->][<!--[$currentYear]-->][<!--[$currentMonth]-->][<!--[$dayKey]-->]" type="text" size="2" value="0" /></td>	
						<!--[/if]-->
					<!--[/foreach]-->
				</tr>
			<!--[/foreach]-->
		</table>
	<!--[/foreach]-->
	
	<!--[foreach from=$dateList item=itemDay key=key]-->
		<table border="1px">
			<tr>
			<th>
				Room Type
			</th>
			<!--[foreach from=$itemDay item=itemDay2 key=dayKey name=loopDay]-->
				<!--[if $smarty.foreach.loopDay.index >= 15]-->
					<th><!--[$dayKey]--><br /><!--[$itemDay2|substr:0:3]--></th>	
				<!--[/if]-->
			<!--[/foreach]-->
			</tr>
			<!--[foreach from=$roomList item=itemRoom key=key]-->
				<tr>
					<td>
						<!--[$itemRoom.name]-->
					</td>
					<!--[foreach from=$itemDay item=itemDay2 key=dayKey name=loopDay]-->
						<!--[if $smarty.foreach.loopDay.index >= 15]-->
							<td><input name="form[<!--[$itemRoom.id]-->][<!--[$currentYear]-->][<!--[$currentMonth]-->][<!--[$dayKey]-->]" type="text" size="2" value="0" /></td>	
						<!--[/if]-->
					<!--[/foreach]-->
				</tr>
			<!--[/foreach]-->
		</table>
	<!--[/foreach]-->

<!--[/if]-->


<input type="submit" value="submit">
</form>


